using System;
using System.Collections.Generic;
using System.Text;

namespace GameEditor.Common
{

    public struct Range<T>
    {
        public T Minimum;
        public T Maximum;
        public Range(T minimum, T maximum)
        {
            this.Maximum = maximum;
            this.Minimum = minimum;
        }
    }
    public interface IDataProxy<T>
    {
        T Value
        {
            get;
        }
    }


    public class DataProxy<T> : IDataProxy<T>
    {
        private DelegateWithReturnValue<T> getValue;

        public DelegateWithReturnValue<T> GetValue
        {
            get { return getValue; }
            set { getValue = value; }
        }
        public DataProxy(DelegateWithReturnValue<T> getValue)
        {
            this.getValue = getValue;
        }

        public T Value
        {
            get
            {
                return getValue();
            }
        }

    };
}

public class ValueWrapper
{
    private object value;

    public object Value
    {
        get { return value; }
        set { this.value = value; }
    }
    public ValueWrapper()
    {
    }
    public ValueWrapper(object v)
    {
        this.value = v;
    }
    public override bool Equals(object obj)
    {
        if (value == null)
            return value == obj;
        return value.Equals(obj);
    }
    public override int GetHashCode()
    {
        if (value == null)
            return base.GetHashCode();
        return value.GetHashCode();
    }
    public override string ToString()
    {
        if (value == null)
            return "<null>";
        return value.ToString();
    }
}
